package com.fzg.common.tool;

import lombok.extern.slf4j.Slf4j;

/**
 * create by fzg
 * 2022/3/15 19:39
 */

@Slf4j
public class Medthods {

    /**
     * java用replace方法替换身份证号的中间位数
     */
    public static String replaceIdNumberByStar(String idNumber){
        String uIdNumber;
        if (idNumber == null || idNumber.length() < 18){
            return "未知";
        }
        uIdNumber = idNumber.replace(idNumber.substring(6, 14), "********");
        return uIdNumber;
    }

}
